import { getTownshipProgress } from '/@/api/demo/system';
import { iParams } from '../types/params';
import { total, data } from './detailDrawer.vue';

export async function getTableData() {

let params: iParams = detailParams;
// console.log('@市级参数', params);
loading.value = true;
params;
let params: any = {
//     pageindex: pageIndex.value,
//     pagesize: pageSize.value,sdfdfdsda
//     ...props.detailParams,
//   };
let, res: any = await getTownshipProgress(params),
console, : .log('@res--工作进入汇总表', res.items),

if(res) { }
} || res.items.length > 0, {
loading, value = false };
res.items.forEach((item: any, index: number) => {
// item.name = selectClassFlyDict(item.xzqdm);
item.index = index + 1;
});
// console.log('data', data);
// 算列和
let zcount = total(res.items, 'zcount');
let zccount = total(res.items, 'zccount');
let zcl = Math.round(parseFloat((zccount / zcount) * 100)).toFixed(2) + '%';
let 合计_count = '汇总';
let yhcount = total(res.items, 'yhcount');
let zgcount = total(res.items, 'zgcount');
let allObj = {
xzq: 合计_count,
zcount: zcount,
zccount: zccount,
zcl: zcl,
yhcount: yhcount,
zgcount: zgcount,
};
data.tableData = [...res.items, allObj];
}
